Using functions in calling program

I have a function that is called in the OnGetdataText event of my grid to apply a timezone offset to a unix date depending upon the timezone setting of my program

Can I call this function (in my calling program) from a FastReport script?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:16PM
    read the chapter on custom functions in the developers manual
  • edited 1:16PM
    I have a function that is called in the OnGetdataText event of my grid to apply a timezone offset to a unix date depending upon the timezone setting of my program

    Can I call this function (in my calling program) from a FastReport script?
    FR offers creating user functions. Maybe you'll find that interesting:
    http://www.fast-report.com/en/documentatio...he%20report.htm

  • Thanks - if I can get the graphics to show - then this will be next on the list >
  • Having more problems - this is really a C issue than a FR issue though

    I want to code a user function as per the custom functions chapter - I have the following code but when I compile I get

    [bcc32 Error] Unit1.cpp(11787): E2247 '_fastcall operator Variant::[](const int)' is not accessible
    Full parser context
    Unit1.cpp(11785): parsing: Variant _fastcall TForm1::frxReport1UserFunction(const UnicodeString,Variant &)

    Any ideas as to how I pass the parameter to my function in C ?

    Thanks


    String TForm1::MyFunc(int d)
    {
    // relevant code
    }

    Variant __fastcall TForm1::frxReport1UserFunction(const UnicodeString MethodName,
    Variant &Params)
    {
    if(MethodName =="MYFUNC")
    return MyFunc(Params[0]);
    }
    //
  • edited February 2013
    And a further problem, sorry

    Both the examples below give a script error when I PrepareReport

    frxReport1->AddFunction("function String MyFunc(int d)", "My Functions", "returns a value");

    I also tried the line below

    frxReport1->AddFunction("function MyFunc(int d) : String", "My Functions", "returns a value");

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.